home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / tchk050.arc / TCHKDEMO.C < prev    next >
Text File  |  1988-11-19  |  2KB  |  75 lines

  1. #include <howard.h>
  2. #include <menuhk.h>
  3. #include <video.h>
  4. #include <color.h>
  5. #include <keyboard.h>
  6. #include <keycode.h>
  7. #include <stringhk.h>
  8. #include <datehk.h>
  9. #include <timehk.h>
  10. #include <ibm.h>
  11. #include <filehk.h>
  12.  
  13. #include <alloc.h>
  14. #include <string.h>
  15. #include <stdio.h>
  16. #include <dos.h>
  17.  
  18. void goodbye(void);
  19.  
  20. main()
  21. {
  22.     char key=0, cmdkey[9], keystr[20];
  23.     byte *cmd[9] = { "Video", "Keyboard", "String",
  24.                      "Time", "Date", "IBM",
  25.                      "File", "Menu", "Quit" };
  26.     byte *msg[9] = { "Screen routines", "Keyboard routines",
  27.                      "String manipulations", "Time functions",
  28.                      "Date functions", "IBM machine specific functions",
  29.                      "File functions", "Menu functions",
  30.                      "Quit this demo" };
  31.     byte cmdcol[9], msglen[9];
  32.     int i;
  33.  
  34.     cls();
  35.     set_color(BROWN|B_BLACK);
  36.     gotoxy(0,5);
  37.     putstr("This is a sample of TCHK's slash bar menu function");
  38.     lotus_setup(9,cmd,cmdkey,cmdcol,msg,msglen);
  39.     key = menu_lotus(9,cmdkey,cmd,cmdcol,msg,msglen,LCYAN,LWHITE|B_RED,2,TRUE,0,72,LGREEN);
  40.     set_color(BROWN);
  41.     putsay(6,0,"You selected ");
  42.     for (i=0; i<9; i++)
  43.         if (key == cmdkey[i]) {
  44.             strcpy(keystr,cmd[i]);
  45.             break;
  46.         }
  47.     set_color(LRED);
  48.     putsay(6,13,keystr);
  49.     goodbye();
  50. }
  51.  
  52.  
  53. void goodbye(void)
  54. {
  55.     extern byte frame2[9];
  56.  
  57.     set_color(BLACK|B_BLUE);
  58.     box(8,7,21,50,frame2);
  59.     set_color(LCYAN);
  60.     putsay(10,10,"This is but a small sample of TCHK");
  61.     putsay(12,10,"If you like this library, you can");
  62.     set_color(LRED|BLINK);
  63.     putsay(13,10,"REGISTER");
  64.     set_color(LCYAN);
  65.     putsay(13,19,"for the measly sum of ");
  66.     set_color(LRED|BLINK);
  67.     putsay(13,41,"$15");
  68.     set_color(LCYAN);
  69.     putsay(13,44,".");
  70.     putsay(15,10,"Registered users get all size memory");
  71.     putsay(16,10,"models instead of just the small model");
  72.     putsay(17,10,"distributed publicly.");
  73.     putsay(19,10,"Check out TCHK.DOC for more information");
  74. }
  75.